﻿/**
 * ...
 * @author Natalia Ukhorskaya
 */

package gui.hug;

import flash.display.SimpleButton;
import flash.text.TextFormat;
import gui.hug.priv.HUGButtonDisplayState;

class HUGLinkButton extends HUGButton
{
	private static inline var DEFAULT_TEXT_FORMAT : TextFormat = new TextFormat("Arial", 12, HUGColors.VK_BUTTON);
	private static inline var DEFAULT_BG_COLOR : Int = HUGColors.VK_BACKGROUND;
	
	private var textFormat : TextFormat;
	private var bgColor : Int;
	
	public function new(text : String, ?format : TextFormat, ?color : Int) {
		super(text);
		this.textFormat = null == format ? DEFAULT_TEXT_FORMAT : format;
		this.bgColor = null == color ? DEFAULT_BG_COLOR : color;
		
		textFormat.underline = false;
		downState = new HUGButtonDisplayState(text, textFormat, bgColor, 0);
		upState = new HUGButtonDisplayState(text, textFormat, bgColor, 0);
		hitTestState = new HUGButtonDisplayState(text, textFormat, bgColor, 0);
		
		textFormat.underline = true;
		overState = new HUGButtonDisplayState(text, textFormat, bgColor, 0);
	}
}
 